PROJECT OBJECTIVE: Design a DL based car identification model

1. Milestone 1: [ Score: 40 points]
Input: Context and Dataset
Process:

Step 1: Import the data. [ 3 points ]

Function to read all images

Step 2: Map training and testing images to its classes. [ 6 points ]

Step 3: Map training and testing images to its annotations. [ 6 points ]

Function to read the Annotations file and map the details to respective image.

Note: Assigning classes and anaotations in separate steps will result in memory and compute waste. So the below function addresses both the assignments in one go.

As we see above, for around 140 cars we have 40-50 images, for around 50 cars we have 30-40 images. For few cars we have very less numbers of images i.e 20-30. For just 1 car we have high number of images i.e 60-70

From the above samples, it is evident that sizes of the images are way different from each other. To use in CNN model the images need to be resized to common size and normalized.

As we see above, for around 140 cars we have 40-50 images, for around 50 cars we have 30-40 images. For few cars we have very less numbers of images i.e 20-30. For just 1 car we have high number of images i.e 60-70

This behaviour is very similar to train set.

From the above samples, it is evident that sizes of the images are way different from each other. To use in CNN model the images need to be resized to common size and normalized.

Step 4: Display images with bounding box. [ 5 points ]

Step 5: Design, train and test basic CNN models to classify the car. [ 10 points ]

Normalize the images

Basic CNN classifier model

Insights:

The model has produced 97.36% accuracy in train set and just 3.32% accuracy in test set.

The model has overfitted in training set, giving very low accuracy in test set.This model needs further hyperparameter tuning. We may need to apply transfer learning/combine few more models in order to improve accuracy.

2. Milestone 2: [ Score: 60 points]

Tuning CNN model with Image Augmentation

From the above graphs, it is evident that CNN model with image augmentation did not give good predictions either. Even the predictions in train set is not good.

Let us try transfer learning using few famous architectures

VGG19 model for classifying the car models

VGG19 model has given better results compared to basic CNN model. The model has given 98.87% accuracy in train set and 15.41% in test set.

ResNet50 model for classifying the car models

MobileNet model for classifying the car models

Of all the models tried above, MobileNet model has given best results. The model has produced 99.82% accuracy in train set and 52.27% accuracy in test set.

As shown above, the MobileNet model has correctly predicted all the 3 random test samples. The classification model MobileNet can be saved for future use.

Step 2: Design, train and test RCNN & its hybrids based object detection models to impose the bounding box or mask over the area of interest. [ 10 points ]

Object Detection models

Train and Test dataset preparation

MobileNet model for car detection with mask

MobileNet has given good accuracies in both train set and test set. In train set, the model has given 89.31% dice_coefficient and in test set 88.02% dice_coefficient. Since the results are very close in train and test set, the model has consistently performed well and can be saved for future use.

Showing sample images and the predicted mask area.

YOLO model for car detection with bounding box

YOLO3 model has also produced good results. In the above plots, yolo model has correctly detected the cars in the random samples images.

Step 3: Pickle the model for future prediction [ 5 Points]

Models can also be saved as below

Conclusion

Of all the models tried above, MobileNet gave consistent and better predictions for both classification problem and object detection problem. Both models has given correct predictions for the random test samples tried. Hence the MobileNet models for both classification and object detection are saved for future use.

Step 4: Final Report [40 Points]

Final report is created separately as word document. The same will be uploaded to the Solution link.

THE END